package com.csnf.service.impl;

import com.csnf.mapper.StorageMapper;
import com.csnf.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class StorageServiceImpl implements StorageService {

    @Autowired
    StorageMapper storageMapper;

    @Transactional   //启用本地事务
    @Override
    public int updateStorage(String productCode, int count) {

        int r = storageMapper.updateStorage(productCode, count);

//        int a = 10/0;

        return r;
    }
}
